package com.example.baidu_map_plugin.mapview;

import android.content.Context;

import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.StandardMessageCodec;
import io.flutter.plugin.platform.PlatformView;

abstract public class FlutterNativeViewBaseFactory<T extends PlatformView> extends io.flutter.plugin.platform.PlatformViewFactory {
    protected final BinaryMessenger messenger;
    protected Context context;

    public FlutterNativeViewBaseFactory(Context context, BinaryMessenger messenger) {
        super(StandardMessageCodec.INSTANCE);
        this.messenger = messenger;
        this.context = context;
    }

    @Override
    public PlatformView create(Context context, int id, Object o) {
        return createPlatformView(this.context, id, o);//不要传方法中的context

    }

    abstract public T createPlatformView(Context context, int id, Object o);
}